#include "wuEnanitoKinectManager.h"

wuEnanitoKinectManager::wuEnanitoKinectManager()
{
}

wuEnanitoKinectManager::~wuEnanitoKinectManager()
{
}

void wuEnanitoKinectManager::setup(ofxBox2d * _box2d, int _vw, int _vh)
{
	wuBase2dManager::setup(_box2d, _vw, _vh);
	bAlive = false;
	initX = 100;
	initY = 100;
}

void wuEnanitoKinectManager::initPosition(int _x, int _y)
{
	initX = _x;
	initY = _y;
}

void wuEnanitoKinectManager::action(int _action)
{
    if(_action == ACT_PLAY)
    {
        enanito.setup(box2d, vw, vh, initX, initY);
        bAlive = true;
    }
    if(_action == ACT_NONE)
    {
        enanito.clear();
        bAlive = false;
    }

}

void wuEnanitoKinectManager::update()
{
}

void wuEnanitoKinectManager::update(Skeleton _skel, unsigned char* colorSkin, unsigned char* graySkin)
{
    if(bAlive)
        enanito.update(_skel, colorSkin, graySkin);
}

void wuEnanitoKinectManager::draw(bool pinta_bg, int offX)
{
    if(bAlive)
        enanito.draw(pinta_bg, offX);
}

void wuEnanitoKinectManager::setScale(float _scale)
{
    if(bAlive)
        enanito.setScale(_scale);
}
void wuEnanitoKinectManager::setContourAmount(int _amount)
{
    if(bAlive)
        enanito.setContourAmount(_amount);
}
void wuEnanitoKinectManager::setPosition(int _x, int _y)
{
    if(bAlive)
        enanito.setPosition(_x, _y);
}

int wuEnanitoKinectManager::getStatus()
{
    return (int)bAlive;
}
